#include "NearKickTestCase.h"

/**
 * prekryta metoda samotneho testu
 */
bool NearKickTestCase::Test()
{
	printf("\nNearKickTestCase::Test()");

	GetNearKickBehaviour()->Behave(Point(15,15));

	if(world->ball->pos.GetX()>13 && world->ball->pos.GetX()<17 && world->ball->pos.GetY()>13 && world->ball->pos.GetY()<17)
	{	
		DBGN_TEST("TEST NearKickTestCase USPESNY ");
		fprintf(unitTestsLogFile, "ODCHYLKA: x:%f  y:%f \n",world->ball->pos.GetX()-15,world->ball->pos.GetY()-15);
		SetIsTestSuccess(true);
		return true;
	}
	return false;

}


bool NearKickTestCase::PrepareBeforeTest()
{
	printf("\nNearKickTestCase::PrepareBeforeTest()");
	Point ball = world->ball->pos;
	GetRunToPositionBehaviour()->Behave(ball, 2);
	if(world->me->pos.GetX()>ball.GetX()-1 && world->me->pos.GetX()<ball.GetX()+1 && world->me->pos.GetY()>ball.GetY()-1 && world->me->pos.GetY()<ball.GetY()+1)
	{
		DBGN_TEST("------------------------------------------------------\n");
		DBGN_TEST("TEST NearKickTestCase PRIPRAVENY\n");
		return true;
	}
	return false;
}
